package cn.edu.zut.score.service;

import cn.edu.zut.score.core.constant.RoleEnum;
import cn.edu.zut.score.core.domain.PageResponse;
import cn.edu.zut.score.core.domain.RestResponse;
import cn.edu.zut.score.core.dto.request.LoginRequest;
import cn.edu.zut.score.core.dto.request.PasswordRequest;
import cn.edu.zut.score.core.dto.request.UserPageRequest;
import cn.edu.zut.score.core.dto.response.UserResponse;
import cn.edu.zut.score.core.entity.Info;
import cn.edu.zut.score.core.entity.User;
import com.baomidou.mybatisplus.extension.service.IService;

import java.io.InputStream;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 服务类
 * </p>
 *
 * @author zby
 * @since 2021-06-25
 */
public interface IUserService extends IService<User> {

    RestResponse<String> login(LoginRequest loginRequest);

    RestResponse<Map<String, String>> info();

    RestResponse<String> logout();

    RestResponse<UserResponse> getUserById(Long id);

    RestResponse<UserResponse> getCurrentUser();

    RestResponse<UserResponse> addTeacher(User teacher);

    RestResponse<UserResponse> saveUser(User user);

    RestResponse<UserResponse> updateCurrentUser(User teacher, RoleEnum roleEnum);

    RestResponse<UserResponse> restCurrentUserPassword(PasswordRequest passwordRequest);

    RestResponse<Long> deleteUserById(Long id);

    RestResponse<Integer> deleteUsersById(List<Long> ids);

    RestResponse<Integer> importUsers(InputStream file, RoleEnum roleEnum) throws Exception;

    RestResponse<PageResponse<UserResponse>> queryUsers(UserPageRequest pageRequest);

    List<Info> queryUserNamesByIds(List<Long> ids);

    RestResponse<List<Info>> queryAllUsersByRole(RoleEnum roleEnum);

    List<Info> queryUserInfosNotInIds(List<Long> ids);

    List<Long> getClassStudentIdsById(Long classid);

    RestResponse<Boolean> isPasswordValid();
}
